local wuyulong = fk.CreateSkill {
  name = "lingling__wuyulong",
}

Fk:loadTranslationTable{
  ["lingling__wuyulong"] = "舞鱼龙",
  [":lingling__wuyulong"] = "出牌阶段限一次，你可以摸两张牌，然后与一名其他角色交换所有手牌。",

  ["#lingling__wuyulong"] = "舞鱼龙：摸两张牌，然后与一名角色交换所有手牌",
  ["#lingling__wuyulong-choose"] = "舞鱼龙：与一名角色交换手牌",
}

wuyulong:addEffect("active", {
  anim_type = "drawcard",
  prompt = "#lingling__wuyulong",
  can_use = function(self, player)
    return player:usedSkillTimes(wuyulong.name, Player.HistoryPhase) == 0
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    player:drawCards(2, wuyulong.name)
    if player.dead then return end
    local targets = room:getOtherPlayers(player, false)
    if player:isKongcheng() then
      targets = table.filter(targets, function (p)
        return not p:isKongcheng()
      end)
    end
    if #targets > 0 then
      local to = room:askToChoosePlayers(player, {
        min_num = 1,
        max_num = 1,
        targets = targets,
        skill_name = wuyulong.name,
        prompt = "#lingling__wuyulong-choose",
        cancelable = false,
      })[1]
      room:swapAllCards(player, {player, to}, wuyulong.name)
    end
  end,
})

return wuyulong
